class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: D = None
        self.x: G = None
        self.s: H = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: B = None
        self.p: A = None
        self.q: H = None
        self.s: F = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: G = None
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: D = None
        self.x: G = None
        self.s: H = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: B = None
        self.p: A = None
        self.q: H = None
        self.s: F = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: G = None
        self.t: G = None
        self.txt = txt

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

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