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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.q: E = None
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: G = None
        self.q: D = None
        self.s: B = None
        self.p: B = None
        self.w: B = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.q: E = None
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: G = None
        self.q: D = None
        self.s: B = None
        self.p: B = None
        self.w: B = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

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

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