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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

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

k.s = l
k.y = c
k.u = d
f.w = k
l.t = c
l.w = f
l.z = j
d.u = c
d.v = c
c.v = l
c.p = d
c.o = j
c.z = f
j.y = d
j.v = d
j.s = f
j.o = c
assert d.u.z.w.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

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

k.s = l
k.y = c
k.u = d
f.w = k
l.t = c
l.w = f
l.z = j
d.u = c
d.v = c
c.v = l
c.p = d
c.o = j
c.z = f
j.y = d
j.v = d
j.s = f
j.o = c
assert d.u.z.w.u.v.txt == "c"