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

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

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

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

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

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

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

e.o = i
h.s = f
d.u = f
d.r = c
d.x = c
d.p = h
d.s = n
c.y = n
c.v = i
c.s = i
c.z = d
c.u = h
c.p = h
f.s = e
g.t = h
a.y = g
a.v = e
a.s = e
a.z = d
a.u = h
a.p = h
i.o = e
n.t = h
assert n.t.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

e.o = i
h.s = f
d.u = f
d.r = c
d.x = c
d.p = h
d.s = n
c.y = n
c.v = i
c.s = i
c.z = d
c.u = h
c.p = h
f.s = e
g.t = h
a.y = g
a.v = e
a.s = e
a.z = d
a.u = h
a.p = h
i.o = e
n.t = h
assert n.t.s.s.txt == "e"