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

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

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

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

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

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

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

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

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

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

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

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

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

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

n.u = d
k.z = d
a.y = c
a.z = n
a.t = k
d.y = c
c.r = k
c.x = d
c.z = d
c.o = a
j.p = k
j.z = k
assert c.z.y.r.z.y.r.txt == "k"