class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.w: B = None
        self.q: B = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: E = None
        self.q: G = None
        self.r: C = None
        self.u: G = None
        self.x: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.v: E = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.w: B = None
        self.q: B = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: E = None
        self.q: G = None
        self.r: C = None
        self.u: G = None
        self.x: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.v: E = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

f.y = a
f.z = d
f.q = c
l.x = m
j.z = g
j.r = g
j.t = g
j.w = l
j.q = l
j.x = f
m.w = a
m.u = a
a.w = c
a.v = n
a.q = k
a.u = k
a.r = j
a.x = j
a.y = f
g.r = m
g.t = l
g.v = c
k.x = l
k.p = l
k.v = a
k.t = d
c.y = g
n.w = c
n.v = a
n.q = k
n.u = k
n.r = d
n.x = j
n.y = f
d.z = g
d.r = g
d.t = g
d.w = l
d.q = l
d.x = f
assert m.u.w.y.r.w.txt == "a"