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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: F = None
        self.t: F = None
        self.u: C = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

j.p = b
j.x = b
j.y = l
m.v = k
m.y = e
m.t = e
m.u = n
m.x = c
m.z = f
k.w = b
c.q = b
i.x = k
i.t = c
i.q = m
l.w = c
l.x = c
l.s = b
l.u = m
l.t = i
l.q = i
b.v = k
b.u = k
b.y = l
b.t = l
b.x = c
b.z = f
n.w = m
f.p = m
f.x = b
f.y = e
e.w = c
e.x = c
e.s = m
e.u = b
e.t = i
e.q = i
assert f.x.x.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: F = None
        self.t: F = None
        self.u: C = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

j.p = b
j.x = b
j.y = l
m.v = k
m.y = e
m.t = e
m.u = n
m.x = c
m.z = f
k.w = b
c.q = b
i.x = k
i.t = c
i.q = m
l.w = c
l.x = c
l.s = b
l.u = m
l.t = i
l.q = i
b.v = k
b.u = k
b.y = l
b.t = l
b.x = c
b.z = f
n.w = m
f.p = m
f.x = b
f.y = e
e.w = c
e.x = c
e.s = m
e.u = b
e.t = i
e.q = i
assert f.x.x.q.z.txt == "f"