class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: B = None
        self.u: H = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: J = None
        self.z: D = None
        self.y: F = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: C = None
        self.t: A = None
        self.y: H = None
        self.u: I = None
        self.v: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: J = None
        self.z: D = None
        self.y: F = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: C = None
        self.t: A = None
        self.y: H = None
        self.u: I = None
        self.v: H = None
        self.txt = txt

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

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