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

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

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

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

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

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

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

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

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

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

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

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

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

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

g.u = e
e.r = l
k.q = g
k.y = f
k.x = f
k.t = a
a.v = e
a.y = f
a.u = k
a.q = k
l.x = a
l.t = a
f.q = k
assert k.q.u.r.t.y.txt == "f"