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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: E = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: H = None
        self.w: B = None
        self.y: D = None
        self.v: H = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: E = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: H = None
        self.w: B = None
        self.y: D = None
        self.v: H = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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