class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.s: B = None
        self.w: B = None
        self.t: D = None
        self.txt = txt

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

g = A("g")
a = B("a")
e = C("e")
n = D("n")
k = E("k")
b = F("b")

g.u = k
a.v = b
a.q = e
a.r = e
e.s = b
e.u = b
e.t = b
e.x = a
e.z = n
n.q = b
n.w = b
n.t = g
n.x = a
k.z = n
k.t = n
k.r = a
k.s = a
k.w = a
b.w = g
b.r = a
assert n.t.u.w.r.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.s: B = None
        self.w: B = None
        self.t: D = None
        self.txt = txt

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

g = A("g")
a = B("a")
e = C("e")
n = D("n")
k = E("k")
b = F("b")

g.u = k
a.v = b
a.q = e
a.r = e
e.s = b
e.u = b
e.t = b
e.x = a
e.z = n
n.q = b
n.w = b
n.t = g
n.x = a
k.z = n
k.t = n
k.r = a
k.s = a
k.w = a
b.w = g
b.r = a
assert n.t.u.w.r.x.r.txt == "e"