class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: C = None
        self.y: B = None
        self.z: H = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: A = None
        self.txt = txt

d = A("d")
k = B("k")
e = C("e")
a = D("a")
f = E("f")
c = F("c")
m = G("m")
i = H("i")
h = E("h")
n = C("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: A = None
        self.txt = txt

d = A("d")
k = B("k")
e = C("e")
a = D("a")
f = E("f")
c = F("c")
m = G("m")
i = H("i")
h = E("h")
n = C("n")

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