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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.w: E = None
        self.y: D = None
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
b = C("b")
d = D("d")
l = E("l")
f = F("f")
c = G("c")
i = F("i")
a = B("a")
e = A("e")

n.v = d
n.p = c
j.x = n
b.u = d
b.y = d
b.v = d
b.s = l
b.w = l
b.p = c
d.q = l
d.p = a
l.v = b
l.q = b
l.x = d
l.p = i
f.p = j
f.q = c
f.r = e
f.v = l
c.t = b
c.u = b
c.s = e
i.p = j
i.q = c
i.r = e
i.v = l
a.x = e
e.v = d
e.p = c
assert a.x.p.u.w.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.w: E = None
        self.y: D = None
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
b = C("b")
d = D("d")
l = E("l")
f = F("f")
c = G("c")
i = F("i")
a = B("a")
e = A("e")

n.v = d
n.p = c
j.x = n
b.u = d
b.y = d
b.v = d
b.s = l
b.w = l
b.p = c
d.q = l
d.p = a
l.v = b
l.q = b
l.x = d
l.p = i
f.p = j
f.q = c
f.r = e
f.v = l
c.t = b
c.u = b
c.s = e
i.p = j
i.q = c
i.r = e
i.v = l
a.x = e
e.v = d
e.p = c
assert a.x.p.u.w.p.q.u.txt == "b"