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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.r: E = None
        self.x: C = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.r: E = None
        self.x: C = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

h.w = j
h.v = c
e.y = a
n.z = f
n.y = e
n.p = a
j.v = h
j.w = e
j.u = f
a.y = n
a.w = k
a.t = e
k.z = c
k.t = j
k.y = j
k.s = j
k.r = a
k.x = n
c.z = k
c.t = j
c.y = j
c.s = j
c.r = a
c.x = n
f.y = a
d.w = j
d.v = c
assert h.w.u.y.y.txt == "n"