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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: F = None
        self.u: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: F = None
        self.q: F = None
        self.y: D = None
        self.u: B = None
        self.txt = txt

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

i = A("i")
c = B("c")
d = C("d")
h = D("h")
n = E("n")
a = F("a")
m = A("m")

i.r = a
i.s = n
c.r = h
c.y = a
c.u = n
c.p = d
c.w = d
d.z = m
d.x = c
d.o = h
h.p = n
h.s = m
h.o = a
n.r = h
n.y = h
n.p = a
n.q = a
n.u = c
a.s = d
a.w = d
a.u = i
a.o = n
m.r = a
m.s = n
assert c.r.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: F = None
        self.u: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: F = None
        self.q: F = None
        self.y: D = None
        self.u: B = None
        self.txt = txt

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

i = A("i")
c = B("c")
d = C("d")
h = D("h")
n = E("n")
a = F("a")
m = A("m")

i.r = a
i.s = n
c.r = h
c.y = a
c.u = n
c.p = d
c.w = d
d.z = m
d.x = c
d.o = h
h.p = n
h.s = m
h.o = a
n.r = h
n.y = h
n.p = a
n.q = a
n.u = c
a.s = d
a.w = d
a.u = i
a.o = n
m.r = a
m.s = n
assert c.r.o.o.txt == "n"