class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

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

c.r = l
c.q = l
c.u = f
c.s = b
l.y = d
l.r = d
l.o = d
k.o = h
h.w = d
h.v = c
h.q = c
h.t = l
b.o = l
b.z = k
d.u = f
n.w = d
n.v = f
n.t = l
n.q = c
f.r = l
f.q = l
f.u = c
f.s = b
e.w = d
e.v = f
e.t = l
e.q = c
assert b.z.o.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

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

c.r = l
c.q = l
c.u = f
c.s = b
l.y = d
l.r = d
l.o = d
k.o = h
h.w = d
h.v = c
h.q = c
h.t = l
b.o = l
b.z = k
d.u = f
n.w = d
n.v = f
n.t = l
n.q = c
f.r = l
f.q = l
f.u = c
f.s = b
e.w = d
e.v = f
e.t = l
e.q = c
assert b.z.o.q.u.txt == "f"