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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: F = None
        self.y: B = None
        self.z: F = None
        self.o: A = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: F = None
        self.o: E = None
        self.q: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: F = None
        self.y: B = None
        self.z: F = None
        self.o: A = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: F = None
        self.o: E = None
        self.q: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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