class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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