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

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

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

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

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

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

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

m.p = i
m.z = f
m.v = d
b.q = f
b.o = m
b.x = i
f.p = e
f.t = l
f.q = j
f.w = b
f.r = m
l.u = f
l.t = f
l.r = i
l.o = i
l.w = m
j.o = f
d.r = i
i.q = f
i.o = m
i.x = b
e.o = f
a.u = f
a.t = f
a.r = i
a.w = m
a.o = b
h.u = f
h.t = f
h.r = i
h.o = i
h.w = m
assert f.r.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

m.p = i
m.z = f
m.v = d
b.q = f
b.o = m
b.x = i
f.p = e
f.t = l
f.q = j
f.w = b
f.r = m
l.u = f
l.t = f
l.r = i
l.o = i
l.w = m
j.o = f
d.r = i
i.q = f
i.o = m
i.x = b
e.o = f
a.u = f
a.t = f
a.r = i
a.w = m
a.o = b
h.u = f
h.t = f
h.r = i
h.o = i
h.w = m
assert f.r.z.w.txt == "b"