class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: C = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

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

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

g = A("g")
f = B("f")
l = C("l")
d = D("d")
c = E("c")
k = F("k")
e = G("e")
h = D("h")
j = B("j")

g.v = d
g.o = l
g.w = l
g.r = k
f.w = l
f.x = l
l.v = d
d.w = e
d.q = e
d.p = k
d.s = k
d.r = h
d.y = c
d.v = g
c.s = g
c.u = g
c.x = l
c.z = h
k.y = c
k.o = e
k.s = f
k.u = g
k.p = d
e.w = g
e.p = g
e.u = d
h.w = e
h.q = e
h.p = k
h.s = k
h.r = d
h.y = c
h.v = g
j.w = l
j.x = l
assert g.o.v.r.p.u.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: C = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

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

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

g = A("g")
f = B("f")
l = C("l")
d = D("d")
c = E("c")
k = F("k")
e = G("e")
h = D("h")
j = B("j")

g.v = d
g.o = l
g.w = l
g.r = k
f.w = l
f.x = l
l.v = d
d.w = e
d.q = e
d.p = k
d.s = k
d.r = h
d.y = c
d.v = g
c.s = g
c.u = g
c.x = l
c.z = h
k.y = c
k.o = e
k.s = f
k.u = g
k.p = d
e.w = g
e.p = g
e.u = d
h.w = e
h.q = e
h.p = k
h.s = k
h.r = d
h.y = c
h.v = g
j.w = l
j.x = l
assert g.o.v.r.p.u.r.p.txt == "d"