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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: C = None
        self.q: H = None
        self.z: G = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: E = None
        self.v: G = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.t: B = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: C = None
        self.q: H = None
        self.z: G = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: E = None
        self.v: G = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.t: B = None
        self.v: A = None
        self.txt = txt

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

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

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