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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

j = A("j")
k = B("k")
f = C("f")
a = D("a")
i = E("i")
n = F("n")
e = D("e")
d = A("d")

j.t = e
j.s = f
j.w = i
k.y = n
k.s = d
k.z = j
f.v = n
a.v = j
a.u = d
a.p = i
i.w = k
i.u = k
n.r = f
n.p = f
n.o = f
n.u = f
n.q = d
n.x = a
e.v = d
e.u = d
e.p = i
d.t = a
d.s = f
d.w = i
assert n.q.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

j = A("j")
k = B("k")
f = C("f")
a = D("a")
i = E("i")
n = F("n")
e = D("e")
d = A("d")

j.t = e
j.s = f
j.w = i
k.y = n
k.s = d
k.z = j
f.v = n
a.v = j
a.u = d
a.p = i
i.w = k
i.u = k
n.r = f
n.p = f
n.o = f
n.u = f
n.q = d
n.x = a
e.v = d
e.u = d
e.p = i
d.t = a
d.s = f
d.w = i
assert n.q.w.u.txt == "k"