class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.u: D = None
        self.o: A = None
        self.y: D = None
        self.q: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.p: A = None
        self.q: C = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.u: D = None
        self.o: A = None
        self.y: D = None
        self.q: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.p: A = None
        self.q: C = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

l.p = d
l.z = k
e.r = d
e.y = d
e.x = k
e.q = k
e.u = g
e.o = l
m.s = h
m.r = h
m.y = l
b.s = d
h.s = m
h.w = m
h.p = b
h.o = l
h.q = k
k.w = e
k.x = e
k.p = l
k.u = l
k.q = m
k.t = m
d.s = b
g.s = b
assert k.q.r.p.s.s.txt == "b"