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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: G = None
        self.y: F = None
        self.q: G = None
        self.t: A = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.s: F = None
        self.r: B = None
        self.txt = txt

d = A("d")
k = B("k")
g = C("g")
f = D("f")
n = E("n")
a = F("a")
l = G("l")

d.x = a
d.t = n
k.o = a
g.u = n
f.u = a
f.y = a
f.s = l
f.q = l
f.t = d
f.w = d
f.z = g
n.o = g
n.q = g
n.p = f
n.v = f
n.t = f
n.w = l
a.t = g
l.o = a
l.s = a
l.q = n
l.r = k
assert g.u.q.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: G = None
        self.y: F = None
        self.q: G = None
        self.t: A = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.s: F = None
        self.r: B = None
        self.txt = txt

d = A("d")
k = B("k")
g = C("g")
f = D("f")
n = E("n")
a = F("a")
l = G("l")

d.x = a
d.t = n
k.o = a
g.u = n
f.u = a
f.y = a
f.s = l
f.q = l
f.t = d
f.w = d
f.z = g
n.o = g
n.q = g
n.p = f
n.v = f
n.t = f
n.w = l
a.t = g
l.o = a
l.s = a
l.q = n
l.r = k
assert g.u.q.u.o.u.txt == "n"