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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: D = None
        self.z: E = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: I = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.u: J = None
        self.q: B = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: D = None
        self.w: D = None
        self.t: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: D = None
        self.z: E = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: I = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.u: J = None
        self.q: B = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: D = None
        self.w: D = None
        self.t: H = None
        self.txt = txt

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

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