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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.q: E = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.q: E = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.u: C = None
        self.txt = txt

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

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