class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.u: D = None
        self.o: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.u: D = None
        self.o: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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