class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: D = None
        self.o: E = None
        self.y: G = None
        self.z: E = None
        self.u: C = None
        self.p: H = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.r: B = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: I = None
        self.q: H = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.r: A = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: D = None
        self.v: C = None
        self.y: G = None
        self.r: H = None
        self.s: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.r: B = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: I = None
        self.q: H = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.r: A = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: D = None
        self.v: C = None
        self.y: G = None
        self.r: H = None
        self.s: A = None
        self.txt = txt

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

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

l.r = g
l.x = b
l.o = j
l.z = j
l.y = m
l.u = f
l.t = f
l.p = i
e.s = h
e.r = h
f.u = l
f.x = e
f.r = e
f.v = i
b.t = i
b.p = i
b.y = h
b.z = e
j.z = n
j.y = l
j.u = f
j.v = m
h.v = f
h.z = n
h.q = g
h.s = m
m.p = e
m.y = e
m.r = l
m.t = j
g.o = i
g.r = i
g.q = b
g.v = f
g.y = m
g.s = l
n.x = h
i.o = g
i.r = g
i.q = b
i.v = f
i.y = m
i.s = l
assert f.v.r.s.r.s.x.z.txt == "e"