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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.r: E = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.t: B = None
        self.p: D = None
        self.txt = txt

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

i = A("i")
f = B("f")
n = C("n")
d = D("d")
h = E("h")
b = F("b")
c = B("c")
m = E("m")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.r: E = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.t: B = None
        self.p: D = None
        self.txt = txt

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

i = A("i")
f = B("f")
n = C("n")
d = D("d")
h = E("h")
b = F("b")
c = B("c")
m = E("m")
a = F("a")

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