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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: F = None
        self.x: A = None
        self.t: G = None
        self.s: B = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

d = A("d")
f = B("f")
c = C("c")
n = D("n")
m = E("m")
i = F("i")
b = G("b")
h = H("h")
l = C("l")
g = G("g")

d.p = n
f.x = n
f.v = i
f.u = i
c.q = m
c.v = i
n.x = l
n.r = b
n.y = m
n.v = g
n.z = d
n.p = c
n.s = h
m.r = b
i.q = n
i.r = h
i.x = h
i.s = l
i.w = c
i.o = d
b.r = g
b.t = g
b.z = i
b.x = d
b.y = d
b.s = f
b.u = n
h.u = f
l.q = m
l.v = i
g.r = b
g.t = b
g.z = i
g.x = d
g.y = d
g.s = f
g.u = n
assert f.u.r.u.x.r.z.q.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: F = None
        self.x: A = None
        self.t: G = None
        self.s: B = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

d = A("d")
f = B("f")
c = C("c")
n = D("n")
m = E("m")
i = F("i")
b = G("b")
h = H("h")
l = C("l")
g = G("g")

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