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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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