class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: F = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.p: F = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: H = None
        self.y: H = None
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.p: F = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: H = None
        self.y: H = None
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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