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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.x: A = None
        self.s: B = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.y: C = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

f = A("f")
l = B("l")
b = C("b")
c = D("c")
m = E("m")
a = F("a")
k = G("k")

f.u = k
f.p = b
f.w = l
l.y = f
l.x = f
l.s = c
l.z = c
l.r = k
l.t = k
l.u = a
b.w = f
b.x = f
b.y = f
b.z = f
b.v = m
b.s = l
c.y = a
m.r = c
m.p = c
a.t = l
a.x = l
k.v = f
k.p = f
k.r = a
k.y = b
k.w = c
assert m.p.y.t.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.x: A = None
        self.s: B = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.y: C = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

f = A("f")
l = B("l")
b = C("b")
c = D("c")
m = E("m")
a = F("a")
k = G("k")

f.u = k
f.p = b
f.w = l
l.y = f
l.x = f
l.s = c
l.z = c
l.r = k
l.t = k
l.u = a
b.w = f
b.x = f
b.y = f
b.z = f
b.v = m
b.s = l
c.y = a
m.r = c
m.p = c
a.t = l
a.x = l
k.v = f
k.p = f
k.r = a
k.y = b
k.w = c
assert m.p.y.t.u.x.z.txt == "c"