class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: F = None
        self.s: D = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: F = None
        self.s: D = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.r: E = None
        self.txt = txt

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

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