class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.z: E = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

a.w = k
a.t = k
a.v = g
a.y = g
b.t = a
b.y = n
f.v = d
f.s = h
k.y = f
k.u = h
k.t = h
k.p = j
h.p = a
n.q = a
n.y = a
n.r = a
n.z = h
n.w = d
d.q = a
d.y = a
d.r = a
d.z = h
d.w = n
j.y = f
j.u = h
j.t = h
j.p = k
g.v = d
g.s = h
assert n.w.q.t.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.z: E = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

a.w = k
a.t = k
a.v = g
a.y = g
b.t = a
b.y = n
f.v = d
f.s = h
k.y = f
k.u = h
k.t = h
k.p = j
h.p = a
n.q = a
n.y = a
n.r = a
n.z = h
n.w = d
d.q = a
d.y = a
d.r = a
d.z = h
d.w = n
j.y = f
j.u = h
j.t = h
j.p = k
g.v = d
g.s = h
assert n.w.q.t.u.p.txt == "a"