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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: B = None
        self.p: G = None
        self.x: E = None
        self.w: E = None
        self.z: E = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.p: H = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: F = None
        self.txt = txt

m = A("m")
l = B("l")
g = C("g")
k = D("k")
j = E("j")
a = F("a")
e = G("e")
i = H("i")
c = E("c")

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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: B = None
        self.p: G = None
        self.x: E = None
        self.w: E = None
        self.z: E = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.p: H = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: F = None
        self.txt = txt

m = A("m")
l = B("l")
g = C("g")
k = D("k")
j = E("j")
a = F("a")
e = G("e")
i = H("i")
c = E("c")

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