class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: E = None
        self.t: D = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: B = None
        self.s: A = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

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

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

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

n = A("n")
c = B("c")
i = C("i")
k = D("k")
f = E("f")
b = F("b")
l = G("l")
h = C("h")
j = D("j")

n.p = c
n.q = f
n.t = k
n.y = b
c.p = b
c.y = l
c.s = f
i.t = c
i.r = h
i.p = b
i.v = l
k.t = c
k.y = c
k.s = n
k.u = n
k.r = f
f.w = b
b.w = c
l.x = h
h.t = c
h.r = i
h.p = b
h.v = l
j.t = c
j.y = c
j.s = n
j.u = n
j.r = f
assert h.r.v.x.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: E = None
        self.t: D = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: B = None
        self.s: A = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

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

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

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

n = A("n")
c = B("c")
i = C("i")
k = D("k")
f = E("f")
b = F("b")
l = G("l")
h = C("h")
j = D("j")

n.p = c
n.q = f
n.t = k
n.y = b
c.p = b
c.y = l
c.s = f
i.t = c
i.r = h
i.p = b
i.v = l
k.t = c
k.y = c
k.s = n
k.u = n
k.r = f
f.w = b
b.w = c
l.x = h
h.t = c
h.r = i
h.p = b
h.v = l
j.t = c
j.y = c
j.s = n
j.u = n
j.r = f
assert h.r.v.x.p.w.txt == "c"