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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.u: C = None
        self.y: A = None
        self.w: B = None
        self.txt = txt

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

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

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

i.y = k
i.u = d
i.r = d
i.s = j
j.u = k
j.z = d
k.q = i
l.r = i
l.v = i
l.y = i
l.u = k
l.w = j
e.u = l
e.o = i
e.t = k
d.z = l
d.r = j
assert e.u.w.u.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: F = None
        self.r: F = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.u: C = None
        self.y: A = None
        self.w: B = None
        self.txt = txt

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

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

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

i.y = k
i.u = d
i.r = d
i.s = j
j.u = k
j.z = d
k.q = i
l.r = i
l.v = i
l.y = i
l.u = k
l.w = j
e.u = l
e.o = i
e.t = k
d.z = l
d.r = j
assert e.u.w.u.q.y.txt == "k"