class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.x: E = None
        self.v: D = None
        self.s: D = None
        self.z: H = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.u: E = None
        self.r: G = None
        self.w: G = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.z: B = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.u: E = None
        self.r: G = None
        self.w: G = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.z: B = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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