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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.s: B = None
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.s: B = None
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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