class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: H = None
        self.y: F = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: C = None
        self.r: A = None
        self.q: E = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: B = None
        self.t: F = None
        self.x: D = None
        self.r: F = None
        self.q: A = None
        self.v: E = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: C = None
        self.r: A = None
        self.q: E = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: B = None
        self.t: F = None
        self.x: D = None
        self.r: F = None
        self.q: A = None
        self.v: E = None
        self.y: B = None
        self.txt = txt

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

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