class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: H = None
        self.q: F = None
        self.x: E = None
        self.z: E = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: G = None
        self.o: E = None
        self.s: G = None
        self.u: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.o: A = None
        self.u: B = None
        self.q: B = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: H = None
        self.x: D = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.r: A = None
        self.t: C = None
        self.u: F = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

b = A("b")
i = B("i")
c = C("c")
k = D("k")
m = E("m")
j = F("j")
h = G("h")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: G = None
        self.o: E = None
        self.s: G = None
        self.u: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.o: A = None
        self.u: B = None
        self.q: B = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: H = None
        self.x: D = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.r: A = None
        self.t: C = None
        self.u: F = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

b = A("b")
i = B("i")
c = C("c")
k = D("k")
m = E("m")
j = F("j")
h = G("h")
d = H("d")

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