class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: C = None
        self.x: E = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: G = None
        self.v: F = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: E = None
        self.y: G = None
        self.t: E = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.v: E = None
        self.z: D = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.q: F = None
        self.r: E = None
        self.v: H = None
        self.w: A = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: E = None
        self.p: B = None
        self.y: E = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: G = None
        self.v: F = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: E = None
        self.y: G = None
        self.t: E = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.v: E = None
        self.z: D = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.q: F = None
        self.r: E = None
        self.v: H = None
        self.w: A = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: E = None
        self.p: B = None
        self.y: E = None
        self.u: F = None
        self.txt = txt

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

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