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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.q: H = None
        self.z: C = None
        self.x: F = None
        self.t: I = None
        self.u: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: I = None
        self.w: E = None
        self.q: I = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: A = None
        self.z: I = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: F = None
        self.u: H = None
        self.w: C = None
        self.y: I = None
        self.x: I = None
        self.z: B = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.q: H = None
        self.z: C = None
        self.x: F = None
        self.t: I = None
        self.u: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: I = None
        self.w: E = None
        self.q: I = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: A = None
        self.z: I = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: F = None
        self.u: H = None
        self.w: C = None
        self.y: I = None
        self.x: I = None
        self.z: B = None
        self.o: C = None
        self.txt = txt

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

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