class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: C = None
        self.r: C = None
        self.v: A = None
        self.o: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: C = None
        self.r: C = None
        self.v: A = None
        self.o: E = None
        self.x: A = None
        self.txt = txt

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

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