class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.o: G = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.s: F = None
        self.w: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.s: F = None
        self.w: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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