class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.v: E = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.x: B = None
        self.z: E = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

d.o = m
i.u = k
i.p = f
i.s = d
f.p = k
f.u = k
f.v = k
f.o = e
f.s = b
m.r = i
m.x = i
m.q = n
m.u = n
m.z = k
m.o = k
k.y = d
b.u = m
b.o = e
c.o = m
e.u = n
e.o = b
n.r = i
n.x = i
n.q = m
n.u = m
n.z = k
n.o = k
assert i.p.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.v: E = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.x: B = None
        self.z: E = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

d.o = m
i.u = k
i.p = f
i.s = d
f.p = k
f.u = k
f.v = k
f.o = e
f.s = b
m.r = i
m.x = i
m.q = n
m.u = n
m.z = k
m.o = k
k.y = d
b.u = m
b.o = e
c.o = m
e.u = n
e.o = b
n.r = i
n.x = i
n.q = m
n.u = m
n.z = k
n.o = k
assert i.p.o.o.txt == "b"