class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.u: C = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

b = A("b")
l = B("l")
g = C("g")
k = D("k")
a = E("a")
f = F("f")
j = B("j")

b.r = f
l.p = k
l.t = j
l.q = j
l.u = g
l.x = a
g.q = k
g.t = k
g.z = j
k.s = g
k.z = g
a.p = k
a.z = j
f.q = a
f.p = a
f.w = b
f.v = j
j.p = k
j.t = l
j.q = l
j.u = g
j.x = a
assert a.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.u: C = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

b = A("b")
l = B("l")
g = C("g")
k = D("k")
a = E("a")
f = F("f")
j = B("j")

b.r = f
l.p = k
l.t = j
l.q = j
l.u = g
l.x = a
g.q = k
g.t = k
g.z = j
k.s = g
k.z = g
a.p = k
a.z = j
f.q = a
f.p = a
f.w = b
f.v = j
j.p = k
j.t = l
j.q = l
j.u = g
j.x = a
assert a.z.u.z.txt == "j"