class A:
    def __init__(self, txt: str):
        self.t: H = 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.t: F = None
        self.w: H = None
        self.o: B = None
        self.r: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.y: E = None
        self.u: C = None
        self.txt = txt

c = A("c")
e = B("e")
l = C("l")
a = D("a")
m = E("m")
d = F("d")
h = G("h")
g = H("g")
j = C("j")

c.t = g
e.y = m
l.t = d
l.w = g
l.o = e
l.z = e
l.r = h
a.w = m
a.y = m
a.r = l
m.x = c
m.t = c
m.u = c
m.w = a
m.o = a
d.w = a
d.s = l
h.q = j
h.o = c
h.y = g
g.w = c
g.v = h
g.y = m
g.u = l
j.t = d
j.w = g
j.o = e
j.z = e
j.r = h
assert c.t.u.t.w.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = 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.t: F = None
        self.w: H = None
        self.o: B = None
        self.r: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.y: E = None
        self.u: C = None
        self.txt = txt

c = A("c")
e = B("e")
l = C("l")
a = D("a")
m = E("m")
d = F("d")
h = G("h")
g = H("g")
j = C("j")

c.t = g
e.y = m
l.t = d
l.w = g
l.o = e
l.z = e
l.r = h
a.w = m
a.y = m
a.r = l
m.x = c
m.t = c
m.u = c
m.w = a
m.o = a
d.w = a
d.s = l
h.q = j
h.o = c
h.y = g
g.w = c
g.v = h
g.y = m
g.u = l
j.t = d
j.w = g
j.o = e
j.z = e
j.r = h
assert c.t.u.t.w.w.t.txt == "c"