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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: F = None
        self.x: C = None
        self.q: F = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

e = A("e")
d = B("d")
b = C("b")
c = D("c")
f = E("f")
h = F("h")
l = E("l")
m = F("m")

e.u = c
e.s = l
e.x = l
e.o = f
e.q = f
e.v = h
d.q = c
d.w = m
b.x = d
b.q = c
b.t = e
c.x = e
c.u = l
c.o = m
f.x = e
h.u = c
h.v = m
h.q = m
h.x = b
h.p = b
h.r = d
l.x = e
m.u = c
m.v = h
m.q = h
m.x = b
m.p = b
m.r = d
assert h.q.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.o: E = None
        self.q: E = None
        self.v: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: F = None
        self.x: C = None
        self.q: F = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

e = A("e")
d = B("d")
b = C("b")
c = D("c")
f = E("f")
h = F("h")
l = E("l")
m = F("m")

e.u = c
e.s = l
e.x = l
e.o = f
e.q = f
e.v = h
d.q = c
d.w = m
b.x = d
b.q = c
b.t = e
c.x = e
c.u = l
c.o = m
f.x = e
h.u = c
h.v = m
h.q = m
h.x = b
h.p = b
h.r = d
l.x = e
m.u = c
m.v = h
m.q = h
m.x = b
m.p = b
m.r = d
assert h.q.r.q.txt == "c"