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

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

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

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

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

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

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

h.o = a
l.t = n
l.o = e
l.p = e
l.y = c
l.v = c
l.w = h
n.p = a
n.v = c
n.r = e
n.o = e
c.s = h
b.t = l
b.s = n
a.u = b
a.s = b
a.w = n
a.t = e
a.v = e
a.x = c
e.u = b
e.s = b
e.w = n
e.t = a
e.v = a
e.x = c
assert b.s.r.x.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

h.o = a
l.t = n
l.o = e
l.p = e
l.y = c
l.v = c
l.w = h
n.p = a
n.v = c
n.r = e
n.o = e
c.s = h
b.t = l
b.s = n
a.u = b
a.s = b
a.w = n
a.t = e
a.v = e
a.x = c
e.u = b
e.s = b
e.w = n
e.t = a
e.v = a
e.x = c
assert b.s.r.x.s.o.txt == "a"