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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: E = None
        self.v: G = None
        self.x: H = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.txt = txt

j = A("j")
f = B("f")
c = C("c")
h = D("h")
i = E("i")
e = F("e")
k = G("k")
a = H("a")

j.w = k
j.v = a
j.q = c
f.w = a
f.z = e
f.u = c
c.o = i
c.w = a
c.r = a
h.x = j
h.y = k
i.y = c
e.t = f
e.u = i
e.v = k
e.x = a
e.w = h
k.t = c
k.o = c
k.r = e
a.v = h
a.p = j
assert h.x.q.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: E = None
        self.v: G = None
        self.x: H = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.txt = txt

j = A("j")
f = B("f")
c = C("c")
h = D("h")
i = E("i")
e = F("e")
k = G("k")
a = H("a")

j.w = k
j.v = a
j.q = c
f.w = a
f.z = e
f.u = c
c.o = i
c.w = a
c.r = a
h.x = j
h.y = k
i.y = c
e.t = f
e.u = i
e.v = k
e.x = a
e.w = h
k.t = c
k.o = c
k.r = e
a.v = h
a.p = j
assert h.x.q.r.p.txt == "j"