class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: B = None
        self.x: B = None
        self.p: G = None
        self.y: D = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: C = None
        self.p: F = None
        self.x: D = None
        self.t: D = None
        self.z: B = None
        self.u: G = None
        self.txt = txt

l = A("l")
c = B("c")
h = C("h")
m = D("m")
g = E("g")
j = F("j")
e = G("e")
d = E("d")
a = A("a")
b = G("b")

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: C = None
        self.p: F = None
        self.x: D = None
        self.t: D = None
        self.z: B = None
        self.u: G = None
        self.txt = txt

l = A("l")
c = B("c")
h = C("h")
m = D("m")
g = E("g")
j = F("j")
e = G("e")
d = E("d")
a = A("a")
b = G("b")

l.t = m
l.y = m
l.o = c
l.x = c
l.p = b
l.r = a
c.z = h
h.w = d
h.s = a
m.r = h
m.x = e
g.r = l
g.t = m
j.z = c
e.o = g
e.q = h
e.p = j
e.x = m
e.t = m
e.z = c
e.u = b
d.r = a
d.t = m
a.t = m
a.y = m
a.o = c
a.x = c
a.p = e
a.r = l
b.o = d
b.q = h
b.p = j
b.x = m
b.t = m
b.z = c
b.u = e
assert a.r.t.x.p.z.z.s.y.x.txt == "e"