class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: H = None
        self.y: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: I = None
        self.x: G = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.x: C = None
        self.s: A = None
        self.q: D = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: I = None
        self.y: J = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: D = None
        self.v: D = None
        self.u: B = None
        self.z: G = None
        self.w: G = None
        self.p: B = None
        self.y: J = None
        self.q: J = None
        self.x: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.txt = txt

f = A("f")
l = B("l")
h = C("h")
j = D("j")
b = E("b")
c = F("c")
n = G("n")
m = H("m")
d = I("d")
g = J("g")

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: I = None
        self.x: G = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.x: C = None
        self.s: A = None
        self.q: D = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: I = None
        self.y: J = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: D = None
        self.v: D = None
        self.u: B = None
        self.z: G = None
        self.w: G = None
        self.p: B = None
        self.y: J = None
        self.q: J = None
        self.x: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.txt = txt

f = A("f")
l = B("l")
h = C("h")
j = D("j")
b = E("b")
c = F("c")
n = G("n")
m = H("m")
d = I("d")
g = J("g")

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