class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.q: A = None
        self.p: E = None
        self.txt = txt

g = A("g")
k = B("k")
h = C("h")
e = D("e")
n = E("n")
l = A("l")
f = E("f")

g.u = e
g.t = l
g.r = k
k.q = l
h.y = e
e.q = f
n.o = k
n.s = h
n.q = l
n.p = f
l.u = e
l.t = g
l.r = k
f.o = k
f.s = h
f.q = l
f.p = n
assert e.q.p.q.r.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.q: A = None
        self.p: E = None
        self.txt = txt

g = A("g")
k = B("k")
h = C("h")
e = D("e")
n = E("n")
l = A("l")
f = E("f")

g.u = e
g.t = l
g.r = k
k.q = l
h.y = e
e.q = f
n.o = k
n.s = h
n.q = l
n.p = f
l.u = e
l.t = g
l.r = k
f.o = k
f.s = h
f.q = l
f.p = n
assert e.q.p.q.r.q.t.txt == "g"