class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: C = None
        self.s: F = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: F = None
        self.q: C = None
        self.u: E = None
        self.y: E = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: A = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: F = None
        self.q: C = None
        self.u: E = None
        self.y: E = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: A = None
        self.z: B = None
        self.txt = txt

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

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