class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: C = None
        self.o: G = None
        self.w: C = None
        self.r: G = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.txt = txt

e = A("e")
a = B("a")
f = C("f")
i = D("i")
h = E("h")
g = F("g")
c = G("c")
j = D("j")

e.s = c
e.o = c
e.r = c
e.v = f
e.w = f
e.q = h
a.p = g
a.v = h
f.z = g
f.q = h
f.t = a
i.w = h
h.o = a
g.s = j
c.y = g
c.x = f
j.w = h
assert c.x.z.s.w.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: C = None
        self.o: G = None
        self.w: C = None
        self.r: G = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.txt = txt

e = A("e")
a = B("a")
f = C("f")
i = D("i")
h = E("h")
g = F("g")
c = G("c")
j = D("j")

e.s = c
e.o = c
e.r = c
e.v = f
e.w = f
e.q = h
a.p = g
a.v = h
f.z = g
f.q = h
f.t = a
i.w = h
h.o = a
g.s = j
c.y = g
c.x = f
j.w = h
assert c.x.z.s.w.o.p.txt == "g"