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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.y: D = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

d = A("d")
k = B("k")
l = C("l")
f = D("f")
j = E("j")
a = F("a")
b = G("b")
n = H("n")
m = E("m")
c = E("c")

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.y: D = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

d = A("d")
k = B("k")
l = C("l")
f = D("f")
j = E("j")
a = F("a")
b = G("b")
n = H("n")
m = E("m")
c = E("c")

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