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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: A = None
        self.x: B = None
        self.r: H = None
        self.txt = txt

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

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

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

h = A("h")
a = B("a")
n = C("n")
b = D("b")
i = E("i")
k = F("k")
j = G("j")
g = H("g")
d = G("d")

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: A = None
        self.x: B = None
        self.r: H = None
        self.txt = txt

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

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

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

h = A("h")
a = B("a")
n = C("n")
b = D("b")
i = E("i")
k = F("k")
j = G("j")
g = H("g")
d = G("d")

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