class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: F = None
        self.r: F = None
        self.s: D = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: F = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

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

h = A("h")
k = B("k")
m = C("m")
a = D("a")
n = E("n")
d = F("d")
i = E("i")

h.w = k
h.u = d
h.r = d
h.s = a
h.q = a
k.z = a
m.r = d
m.o = d
a.s = m
a.x = m
a.w = k
a.y = k
n.r = d
n.q = d
n.x = d
n.p = a
d.v = h
i.r = d
i.q = d
i.x = d
i.p = a
assert i.x.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: F = None
        self.r: F = None
        self.s: D = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: F = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

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

h = A("h")
k = B("k")
m = C("m")
a = D("a")
n = E("n")
d = F("d")
i = E("i")

h.w = k
h.u = d
h.r = d
h.s = a
h.q = a
k.z = a
m.r = d
m.o = d
a.s = m
a.x = m
a.w = k
a.y = k
n.r = d
n.q = d
n.x = d
n.p = a
d.v = h
i.r = d
i.q = d
i.x = d
i.p = a
assert i.x.v.q.txt == "a"