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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.o: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: G = None
        self.x: D = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.o: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: G = None
        self.x: D = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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