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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: A = None
        self.s: G = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: A = None
        self.s: G = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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