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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.s: G = None
        self.w: G = None
        self.o: E = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: G = None
        self.p: E = None
        self.r: F = None
        self.o: G = None
        self.z: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.s: G = None
        self.w: G = None
        self.o: E = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: G = None
        self.p: E = None
        self.r: F = None
        self.o: G = None
        self.z: F = None
        self.s: C = None
        self.txt = txt

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

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

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