class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.t: E = None
        self.p: F = None
        self.txt = txt

d = A("d")
h = B("h")
b = C("b")
m = D("m")
l = E("l")
a = F("a")
g = G("g")
c = D("c")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.t: E = None
        self.p: F = None
        self.txt = txt

d = A("d")
h = B("h")
b = C("b")
m = D("m")
l = E("l")
a = F("a")
g = G("g")
c = D("c")

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