class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.w: G = None
        self.v: D = None
        self.s: A = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.u: D = None
        self.p: A = None
        self.z: F = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.r: G = None
        self.y: A = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.o: B = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: D = None
        self.txt = txt

b = A("b")
h = B("h")
c = C("c")
a = D("a")
f = E("f")
l = F("l")
g = G("g")
n = A("n")
e = D("e")

b.t = c
b.x = n
b.s = n
b.w = g
b.v = e
b.p = l
b.z = a
h.x = g
h.q = f
c.t = h
a.q = h
a.r = g
a.y = g
a.u = e
a.p = n
a.z = l
a.w = c
f.z = g
f.r = g
f.x = c
f.v = c
f.y = n
f.u = e
l.t = h
l.o = h
l.y = h
l.z = h
l.w = c
g.o = l
g.p = e
n.t = c
n.x = b
n.s = b
n.w = g
n.v = e
n.z = e
n.p = l
e.q = h
e.r = g
e.y = g
e.u = a
e.p = b
e.z = l
e.w = c
assert g.o.w.t.x.p.q.q.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.w: G = None
        self.v: D = None
        self.s: A = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.u: D = None
        self.p: A = None
        self.z: F = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.r: G = None
        self.y: A = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.o: B = None
        self.y: B = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: D = None
        self.txt = txt

b = A("b")
h = B("h")
c = C("c")
a = D("a")
f = E("f")
l = F("l")
g = G("g")
n = A("n")
e = D("e")

b.t = c
b.x = n
b.s = n
b.w = g
b.v = e
b.p = l
b.z = a
h.x = g
h.q = f
c.t = h
a.q = h
a.r = g
a.y = g
a.u = e
a.p = n
a.z = l
a.w = c
f.z = g
f.r = g
f.x = c
f.v = c
f.y = n
f.u = e
l.t = h
l.o = h
l.y = h
l.z = h
l.w = c
g.o = l
g.p = e
n.t = c
n.x = b
n.s = b
n.w = g
n.v = e
n.z = e
n.p = l
e.q = h
e.r = g
e.y = g
e.u = a
e.p = b
e.z = l
e.w = c
assert g.o.w.t.x.p.q.q.y.w.txt == "g"