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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

c.w = a
b.x = c
b.z = c
b.t = g
b.r = j
b.p = f
l.t = c
l.p = b
l.z = b
n.u = f
n.x = a
n.v = b
j.o = c
j.u = c
j.p = l
j.y = a
f.x = g
f.p = l
g.x = f
g.p = k
k.t = c
k.p = b
k.z = b
a.o = c
a.u = c
a.p = l
a.y = j
h.t = c
h.p = b
h.z = b
assert b.z.w.p.t.w.p.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

c.w = a
b.x = c
b.z = c
b.t = g
b.r = j
b.p = f
l.t = c
l.p = b
l.z = b
n.u = f
n.x = a
n.v = b
j.o = c
j.u = c
j.p = l
j.y = a
f.x = g
f.p = l
g.x = f
g.p = k
k.t = c
k.p = b
k.z = b
a.o = c
a.u = c
a.p = l
a.y = j
h.t = c
h.p = b
h.z = b
assert b.z.w.p.t.w.p.z.t.txt == "g"