class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.t: E = None
        self.q: D = None
        self.r: F = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
l = C("l")
c = D("c")
f = E("f")
h = F("h")

e.s = a
e.x = c
e.p = c
a.t = c
a.q = c
a.o = c
a.v = e
a.u = l
l.s = c
l.v = c
l.q = c
l.t = f
l.r = h
c.v = h
c.r = e
c.z = l
f.w = a
f.u = a
f.p = c
f.v = c
f.t = h
h.o = a
h.p = l
h.r = e
assert h.r.s.t.z.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.t: E = None
        self.q: D = None
        self.r: F = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
l = C("l")
c = D("c")
f = E("f")
h = F("h")

e.s = a
e.x = c
e.p = c
a.t = c
a.q = c
a.o = c
a.v = e
a.u = l
l.s = c
l.v = c
l.q = c
l.t = f
l.r = h
c.v = h
c.r = e
c.z = l
f.w = a
f.u = a
f.p = c
f.v = c
f.t = h
h.o = a
h.p = l
h.r = e
assert h.r.s.t.z.r.r.txt == "e"