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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: I = None
        self.v: G = None
        self.s: D = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.u: A = None
        self.w: F = None
        self.r: F = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.r: H = None
        self.w: H = None
        self.u: F = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: I = None
        self.v: G = None
        self.s: D = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.u: A = None
        self.w: F = None
        self.r: F = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.r: H = None
        self.w: H = None
        self.u: F = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: F = None
        self.txt = txt

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

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