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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.z: B = None
        self.u: A = None
        self.o: D = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: B = None
        self.r: E = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.z: B = None
        self.u: A = None
        self.o: D = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: B = None
        self.r: E = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

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

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