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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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