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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: I = None
        self.txt = txt

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

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

c.p = i
c.t = m
i.w = d
i.u = k
i.y = h
m.v = j
m.o = a
m.p = i
m.t = d
h.t = i
h.x = a
k.p = i
k.z = j
f.q = m
f.y = a
j.v = m
j.u = c
j.y = h
a.u = h
a.p = d
d.p = k
assert i.y.x.u.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: I = None
        self.txt = txt

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

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

c.p = i
c.t = m
i.w = d
i.u = k
i.y = h
m.v = j
m.o = a
m.p = i
m.t = d
h.t = i
h.x = a
k.p = i
k.z = j
f.q = m
f.y = a
j.v = m
j.u = c
j.y = h
a.u = h
a.p = d
d.p = k
assert i.y.x.u.t.w.txt == "d"