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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.p: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.p: A = None
        self.s: C = None
        self.txt = txt

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

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