class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.q: B = None
        self.o: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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