class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: B = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: H = None
        self.p: A = None
        self.v: A = None
        self.z: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.r: A = None
        self.v: F = None
        self.t: G = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: H = None
        self.p: A = None
        self.v: A = None
        self.z: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.r: A = None
        self.v: F = None
        self.t: G = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

j.y = b
j.v = l
j.u = h
l.u = h
l.r = b
k.v = g
a.w = h
a.x = h
a.r = m
a.s = m
a.v = j
a.u = j
a.y = d
a.q = k
h.q = m
h.z = m
h.r = g
h.p = j
h.v = j
h.u = k
m.t = a
b.o = j
g.p = h
g.s = b
g.r = j
g.v = m
g.t = c
g.u = l
g.z = k
d.w = h
d.x = h
d.r = m
d.s = m
d.v = j
d.u = j
d.y = a
d.q = k
c.o = j
assert d.r.t.y.w.r.t.txt == "c"