class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: B = None
        self.u: A = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

f.r = c
f.p = i
f.o = i
f.w = b
h.o = i
h.s = c
h.u = k
h.q = f
d.p = m
d.x = h
b.q = m
b.o = m
b.p = i
b.x = c
b.r = d
b.s = d
m.s = i
m.t = b
m.x = e
i.y = d
l.o = i
l.s = c
l.u = k
l.q = e
e.r = l
e.p = i
e.o = i
e.w = b
c.o = i
c.s = h
c.u = f
c.q = k
k.r = c
k.p = i
k.o = i
k.w = b
assert e.w.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: B = None
        self.u: A = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

f.r = c
f.p = i
f.o = i
f.w = b
h.o = i
h.s = c
h.u = k
h.q = f
d.p = m
d.x = h
b.q = m
b.o = m
b.p = i
b.x = c
b.r = d
b.s = d
m.s = i
m.t = b
m.x = e
i.y = d
l.o = i
l.s = c
l.u = k
l.q = e
e.r = l
e.p = i
e.o = i
e.w = b
c.o = i
c.s = h
c.u = f
c.q = k
k.r = c
k.p = i
k.o = i
k.w = b
assert e.w.r.x.txt == "h"