class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.o: H = None
        self.w: D = None
        self.s: E = None
        self.u: C = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: H = None
        self.y: A = None
        self.s: G = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
i = C("i")
f = D("f")
k = E("k")
h = F("h")
c = G("c")
g = H("g")
l = F("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: H = None
        self.y: A = None
        self.s: G = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
i = C("i")
f = D("f")
k = E("k")
h = F("h")
c = G("c")
g = H("g")
l = F("l")

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