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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.t: C = None
        self.v: F = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.p: D = None
        self.r: G = None
        self.z: G = None
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.y: G = None
        self.txt = txt

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

n = A("n")
i = B("i")
g = C("g")
d = D("d")
l = E("l")
e = F("e")
j = G("j")
k = E("k")
b = B("b")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.t: C = None
        self.v: F = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.p: D = None
        self.r: G = None
        self.z: G = None
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.y: G = None
        self.txt = txt

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

n = A("n")
i = B("i")
g = C("g")
d = D("d")
l = E("l")
e = F("e")
j = G("j")
k = E("k")
b = B("b")

n.p = i
n.s = b
i.r = j
i.x = g
i.t = g
i.y = g
i.v = e
g.s = n
g.y = n
g.x = n
g.p = d
g.q = d
g.r = j
g.z = j
d.q = b
d.y = j
d.o = l
d.w = g
l.p = d
l.x = b
l.q = k
e.q = k
e.t = d
e.y = j
j.o = e
j.p = n
j.u = k
j.x = b
k.p = d
k.x = b
k.q = l
b.r = j
b.x = g
b.t = g
b.y = g
b.v = e
assert d.o.q.q.x.txt == "b"