class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: B = None
        self.v: B = None
        self.x: E = None
        self.p: E = None
        self.u: D = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: B = None
        self.v: B = None
        self.x: E = None
        self.p: E = None
        self.u: D = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

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

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