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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.r: H = None
        self.z: G = None
        self.x: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: F = None
        self.u: E = None
        self.x: E = None
        self.o: F = None
        self.z: G = None
        self.r: G = None
        self.y: B = None
        self.w: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.v: H = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.r: H = None
        self.z: G = None
        self.x: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: F = None
        self.u: E = None
        self.x: E = None
        self.o: F = None
        self.z: G = None
        self.r: G = None
        self.y: B = None
        self.w: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.v: H = None
        self.z: E = None
        self.txt = txt

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

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