class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: H = None
        self.r: C = None
        self.x: H = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.o: C = None
        self.v: H = None
        self.q: F = None
        self.s: G = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.txt = txt

f = A("f")
j = B("j")
i = C("i")
b = D("b")
c = E("c")
h = F("h")
k = G("k")
l = H("l")
d = B("d")
m = C("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.o: C = None
        self.v: H = None
        self.q: F = None
        self.s: G = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: F = None
        self.txt = txt

f = A("f")
j = B("j")
i = C("i")
b = D("b")
c = E("c")
h = F("h")
k = G("k")
l = H("l")
d = B("d")
m = C("m")

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