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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.u: H = None
        self.x: D = None
        self.w: D = None
        self.y: H = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.w: G = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.u: H = None
        self.x: D = None
        self.w: D = None
        self.y: H = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.w: G = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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