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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

n = A("n")
e = B("e")
a = C("a")
g = D("g")
l = E("l")
f = F("f")

n.r = e
e.u = l
e.q = a
e.t = a
a.u = f
a.w = g
g.x = e
g.u = e
g.v = a
l.w = a
l.o = a
l.x = e
l.t = f
f.t = e
f.x = l
f.q = l
assert e.u.o.u.t.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

n = A("n")
e = B("e")
a = C("a")
g = D("g")
l = E("l")
f = F("f")

n.r = e
e.u = l
e.q = a
e.t = a
a.u = f
a.w = g
g.x = e
g.u = e
g.v = a
l.w = a
l.o = a
l.x = e
l.t = f
f.t = e
f.x = l
f.q = l
assert e.u.o.u.t.u.x.txt == "e"