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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
l = C("l")
c = D("c")
a = E("a")
n = F("n")
d = D("d")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: D = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
l = C("l")
c = D("c")
a = E("a")
n = F("n")
d = D("d")

k.r = l
k.o = l
k.q = c
k.u = n
j.s = k
j.w = k
j.x = c
j.q = a
l.z = j
c.s = d
c.u = k
c.o = j
a.r = c
a.w = n
a.t = n
a.u = d
a.y = k
a.o = j
n.y = a
d.s = c
d.u = k
d.o = j
assert k.q.o.w.o.txt == "l"