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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.v: B = None
        self.t: C = None
        self.u: G = None
        self.o: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.v: B = None
        self.t: C = None
        self.u: G = None
        self.o: B = None
        self.r: C = None
        self.txt = txt

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

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

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

b.x = f
b.o = f
b.q = l
b.r = l
b.y = l
b.v = m
e.r = m
l.v = m
l.u = m
l.p = g
l.y = g
g.z = f
g.w = f
f.y = j
f.z = e
f.v = e
f.o = e
f.t = l
f.r = l
f.u = m
k.p = m
m.p = j
j.p = m
a.y = j
a.z = e
a.v = e
a.o = e
a.t = l
a.r = l
a.u = m
h.x = a
h.o = a
h.q = l
h.r = l
h.y = l
h.v = m
assert j.p.p.p.p.p.txt == "m"