class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.o: E = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.o: A = None
        self.t: G = None
        self.p: E = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.u: E = None
        self.z: E = None
        self.x: E = None
        self.s: G = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: D = None
        self.z: D = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

d = A("d")
g = B("g")
j = C("j")
n = D("n")
e = E("e")
k = F("k")
h = G("h")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.o: A = None
        self.t: G = None
        self.p: E = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.u: E = None
        self.z: E = None
        self.x: E = None
        self.s: G = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: D = None
        self.z: D = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

d = A("d")
g = B("g")
j = C("j")
n = D("n")
e = E("e")
k = F("k")
h = G("h")

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