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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: D = None
        self.v: B = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: G = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: I = None
        self.r: H = None
        self.x: I = None
        self.p: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: D = None
        self.v: B = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: G = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: I = None
        self.r: H = None
        self.x: I = None
        self.p: G = None
        self.txt = txt

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

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