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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: D = None
        self.r: D = None
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: D = None
        self.r: D = None
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

f.t = j
f.q = j
f.x = l
a.q = i
a.s = i
a.p = j
a.r = n
a.y = b
i.t = b
i.s = b
i.x = n
i.r = n
i.v = j
n.v = i
j.r = n
j.z = n
j.w = i
j.p = i
j.s = b
b.t = j
b.q = i
e.q = i
e.s = i
e.p = j
e.r = n
e.y = b
l.t = j
l.q = j
l.x = f
assert n.v.v.z.txt == "n"