class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.t: H = None
        self.s: I = None
        self.x: C = None
        self.y: I = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: I = None
        self.v: F = None
        self.t: A = None
        self.z: B = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: A = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.t: H = None
        self.s: I = None
        self.x: C = None
        self.y: I = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: I = None
        self.v: F = None
        self.t: A = None
        self.z: B = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: A = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

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

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