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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.p = d
j.x = i
j.t = l
j.u = l
j.z = k
j.w = c
d.r = i
d.u = c
l.r = i
l.s = i
l.p = d
l.w = d
l.t = j
l.q = c
i.p = c
i.z = l
c.u = i
k.u = j
k.q = c
assert d.u.u.p.u.p.u.txt == "i"