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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

g = A("g")
n = B("n")
j = C("j")
m = D("m")
i = E("i")
l = F("l")
c = G("c")
a = H("a")

g.q = i
g.o = i
g.w = j
g.x = l
g.z = m
n.t = m
j.o = n
j.s = n
j.q = m
m.v = j
m.y = n
m.r = n
m.u = n
i.u = j
i.v = a
i.r = m
l.p = c
l.o = j
l.x = i
c.q = a
c.v = l
c.z = g
c.p = i
c.o = n
a.x = i
assert g.x.x.v.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.o: E = None
        self.x: F = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

g = A("g")
n = B("n")
j = C("j")
m = D("m")
i = E("i")
l = F("l")
c = G("c")
a = H("a")

g.q = i
g.o = i
g.w = j
g.x = l
g.z = m
n.t = m
j.o = n
j.s = n
j.q = m
m.v = j
m.y = n
m.r = n
m.u = n
i.u = j
i.v = a
i.r = m
l.p = c
l.o = j
l.x = i
c.q = a
c.v = l
c.z = g
c.p = i
c.o = n
a.x = i
assert g.x.x.v.x.r.txt == "m"