class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.q: B = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

j.u = i
j.x = m
j.z = m
j.q = n
j.t = a
n.s = m
n.v = f
n.t = h
m.s = f
a.w = j
f.x = m
f.y = n
f.t = n
f.z = i
l.w = a
l.r = j
i.w = h
i.r = g
b.s = m
b.v = f
b.t = h
g.u = i
g.x = m
g.z = m
g.q = n
g.t = h
h.w = g
assert m.s.x.s.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.q: B = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

j.u = i
j.x = m
j.z = m
j.q = n
j.t = a
n.s = m
n.v = f
n.t = h
m.s = f
a.w = j
f.x = m
f.y = n
f.t = n
f.z = i
l.w = a
l.r = j
i.w = h
i.r = g
b.s = m
b.v = f
b.t = h
g.u = i
g.x = m
g.z = m
g.q = n
g.t = h
h.w = g
assert m.s.x.s.t.t.txt == "h"