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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: E = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

i = A("i")
a = B("a")
h = C("h")
n = D("n")
e = E("e")
f = E("f")

i.t = h
i.s = f
i.r = f
a.x = n
a.s = f
a.q = h
a.v = i
h.x = n
h.s = e
n.x = f
e.w = h
e.t = h
e.q = n
f.w = h
f.t = h
f.q = n
assert h.s.q.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: E = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

i = A("i")
a = B("a")
h = C("h")
n = D("n")
e = E("e")
f = E("f")

i.t = h
i.s = f
i.r = f
a.x = n
a.s = f
a.q = h
a.v = i
h.x = n
h.s = e
n.x = f
e.w = h
e.t = h
e.q = n
f.w = h
f.t = h
f.q = n
assert h.s.q.x.t.txt == "h"