class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: I = None
        self.x: A = None
        self.w: J = None
        self.r: E = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: D = None
        self.s: J = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: E = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: G = None
        self.y: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: I = None
        self.x: A = None
        self.w: J = None
        self.r: E = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: D = None
        self.s: J = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: E = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: G = None
        self.y: H = None
        self.txt = txt

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

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

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