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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.z: C = None
        self.x: E = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.z: C = None
        self.x: E = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

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

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