class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.p: F = None
        self.s: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.p: F = None
        self.s: C = None
        self.u: F = None
        self.txt = txt

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

l.p = j
j.z = c
j.t = i
j.o = i
j.x = h
e.x = c
e.u = h
m.y = h
h.o = m
h.v = j
h.q = e
i.p = l
i.v = c
c.y = h
c.r = h
c.p = i
c.u = i
c.s = e
d.p = j
assert j.z.p.p.p.x.o.y.txt == "h"