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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: C = None
        self.t: B = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: D = None
        self.x: B = None
        self.o: B = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

b = A("b")
g = B("g")
m = C("m")
d = D("d")
h = E("h")
i = F("i")
e = G("e")
j = H("j")
c = F("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: C = None
        self.t: B = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: D = None
        self.x: B = None
        self.o: B = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

b = A("b")
g = B("g")
m = C("m")
d = D("d")
h = E("h")
i = F("i")
e = G("e")
j = H("j")
c = F("c")

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