class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.u: C = None
        self.q: G = None
        self.y: E = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: C = None
        self.o: G = None
        self.q: G = None
        self.z: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: C = None
        self.o: G = None
        self.q: G = None
        self.z: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

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

m.o = i
m.z = i
m.t = b
m.y = b
m.u = h
m.q = k
a.p = k
a.o = k
a.q = k
a.t = h
a.z = e
a.v = m
j.w = e
f.q = b
b.s = k
b.w = h
e.t = a
e.y = f
k.q = f
k.y = c
i.q = b
c.p = k
c.o = k
c.q = k
c.t = j
c.z = e
c.v = m
h.w = e
assert a.v.q.q.q.s.q.txt == "f"