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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: D = None
        self.z: H = None
        self.p: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: H = None
        self.u: C = None
        self.y: H = None
        self.x: H = None
        self.w: J = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: D = None
        self.z: H = None
        self.p: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: H = None
        self.u: C = None
        self.y: H = None
        self.x: H = None
        self.w: J = None
        self.o: F = None
        self.txt = txt

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

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

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